home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlStatusBarGetTextLength.au3 < prev    next >
Text File  |  2007-09-08  |  1KB  |  41 lines

  1. Opt("MustDeclareVars", 1)
  2.  
  3. #include <GUIConstants.au3>
  4. #Include <GuiStatusBar.au3>
  5.  
  6. Local $gui, $StatusBar1, $msg, $lbl_Info
  7. Local $a_PartsRightEdge[3] = [100, 350, -1]
  8. Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"]
  9.  
  10. ;================================================================
  11. ; Example 1 - Using AutoIt Control
  12. ;================================================================
  13. $gui = GUICreate("Status Bar Get Text Length", 500, -1, -1, -1, $WS_SIZEBOX)
  14. $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText)
  15. $lbl_Info = GUICtrlCreateLabel("Text Length of 3rd Part: " & _GUICtrlStatusBarGetTextLength($StatusBar1, 2), 10, 10, 150, 20)
  16.  
  17. GUISetState(@SW_SHOW)
  18.  
  19.  
  20. While 1
  21.     $msg = GUIGetMsg()
  22.     Select
  23.         Case $msg = $GUI_EVENT_RESIZED
  24.             _GUICtrlStatusBarResize($StatusBar1)
  25.         Case $msg = $GUI_EVENT_CLOSE
  26.             ExitLoop
  27.         Case Else
  28.             ;;;;;
  29.     EndSelect
  30.     
  31. WEnd
  32. GUIDelete()
  33.  
  34. ;================================================================
  35. ; Example 2 - External Control
  36. ;================================================================
  37. Opt("WinTitleMatchMode", 4)
  38. Local $h_win = WinGetHandle("classname=SciTEWindow")
  39. Local $h_status = ControlGetHandle($h_win, "", "msctls_statusbar321")
  40. Local $v_rect = _GUICtrlStatusBarGetText($h_status)
  41. ConsoleWrite("Text: " & _GUICtrlStatusBarGetTextLength($h_status) & @LF)